import csv
a=[{'num':1,'age':1},{'num':2,'age':2},{'num':3,'age':3},{'num':4,'age':4},{'num':5,'age':5},{'num':6,'age':6}]
b=[]

for i in a:
    c = {}
    c['序号']=i['num']
    c['年龄']=i['age']
    b.append(c)
csv_fp=open('列表.csv','w')
sheet_title={'序号','年龄'}
sheet_data=[]
for j in b:
    sheet_data.append(j.values())
writter=csv.writer(csv_fp)
writter.writerow(sheet_title)
writter.writerows(sheet_data)
csv_fp.close()
